//
//  UIListViewCell.h
//  Vgo
//
//  Created by 21CN Vgo on 11-4-6.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
    UIListViewCellStyleDefault = 0,	// Simple cell with text label and image view 
	UIListViewCellStyleCustom		// Cell with no default subview
} UIListViewCellStyle;             // available in iPhone OS 3.0
 
typedef enum {
    UIListViewCellSelectionStyleNone,
    UIListViewCellSelectionStyleBlue,
    UIListViewCellSelectionStyleGray
} UIListViewCellSelectionStyle;
 
typedef enum {
	UIListViewCellEditingStyleNone,
	UIListViewCellEditingStyleDelete,
	UIListViewCellEditingStyleInsert
} UIListViewCellEditingStyle;

@interface UIListViewCell : UIView <NSCoding> {
	IBOutlet UIImageView * _imageView;
	IBOutlet UILabel * _textLabel;
	NSString * _reuseIdentifier;
	UIListViewCellSelectionStyle _selectionStyle;
	BOOL _selected;
	UIListViewCellEditingStyle _editingStyle;
	BOOL _editing;
	BOOL _showingDeleteConfirmation;
	UIListViewCellStyle _cellStyle;
}

+ (id)listViewCellWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle reuseIdentifier:(NSString *)reuseIdentifier __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);

// Designated initializer.  If the cell can be reused, you must pass in a reuse identifier.  You should use the same reuse identifier for all cells of the same form.  
- (id)initWithStyle:(UIListViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
- (id)initWithFrame:(CGRect)theFrame style:(UIListViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);

//-(void)SetDeleteBtnImage:(UIImage *)image forState:(UIControlState)state;

// Content.  These properties provide direct access to the internal label and image views used by the list view cell.  These should be used instead of the content properties below.
@property(nonatomic,readonly,retain) UIImageView  *imageView __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);   // default is nil.  image view will be created if necessary.

@property(nonatomic,readonly,retain) UILabel      *textLabel __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);   // default is nil.  label will be created if necessary.

@property(nonatomic,readonly,copy) NSString       *reuseIdentifier;
- (void)prepareForReuse;                                                        // if the cell is reusable (has a reuse identifier), this is called just before the cell is returned from the list view method dequeueReusableCellWithIdentifier:.  If you override, you MUST call super.

@property(nonatomic) UIListViewCellSelectionStyle   selectionStyle;              // default is UIListViewCellSelectionStyleBlue.
@property(nonatomic,getter=isSelected) BOOL         selected;                   // set selected state (title, image, background). default is NO. animated is NO
//@property(nonatomic,getter=isHighlighted) BOOL      highlighted;                // set highlighted state (title, image, background). default is NO. animated is NO
- (void)setSelected:(BOOL)selected animated:(BOOL)animated;                     // animate between regular and selected state
//- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated;               // animate between regular and highlighted state

@property(nonatomic,readonly) UIListViewCellEditingStyle editingStyle;         // default is UIListViewCellEditingStyle. This is set by UIListView using the delegate's value for cells who customize their appearance accordingly.

@property(nonatomic,getter=isEditing) BOOL          editing;                    // show appropriate edit controls (+/- & reorder). By default -setEditing: calls setEditing:animated: with NO for animated.
- (void)setEditing:(BOOL)editing animated:(BOOL)animated; 

@property(nonatomic,readonly) BOOL                  showingDeleteConfirmation;  // currently showing "Delete" button

@property(nonatomic, readonly) UIListViewCellStyle cellStyle;

//@property(nonatomic, retain) CAShapeLayer *shapeLayer;

//// These methods can be used by subclasses to animate additional changes to the cell when the cell is changing state
//// Note that when the cell is swiped, the cell will be transitioned into the UITableViewCellStateShowingDeleteConfirmationMask state,
//// but the UITableViewCellStateShowingEditControlMask will not be set.
//- (void)willTransitionToState:(UITableViewCellStateMask)state __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
//- (void)didTransitionToState:(UITableViewCellStateMask)state __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);

//-(void)ListviewEnterSingleEditMode;
//-(void)ListviewCancelSingleEditMode;

@end

